package phapp.service.barapp.impl;

import static javacommon.util.Struts2JsonHelper.outJson;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import cn.org.rapid_framework.page.Page;
import cn.org.rapid_framework.page.PageRequest;
import javacommon.base.*;

import phapp.model.barapp.*;
import phapp.dao.barapp.*;
import phapp.service.barapp.impl.*;
import phapp.service.barapp.*;
/**
 * <p> 标题: 会员好友关系表, tc_vip_friend_info  业务处理层
 * <p>Description: spring事务实现层,调用Dao层取数据
 * <p>Copyright: Copyright (c) 2014-10
 * <p>Company: 
 * @see phapp.model.barapp.VipFriend
 * @see phapp.service.barapp.VipFriendManager
 * @see phapp.dao.barapp.VipFriendDao
 * @author you name
 * @version 1.0
*/

@Component("vipFriendManager")
@Transactional
public class VipFriendManagerImpl extends BaseManager<VipFriend,java.lang.Integer>
               implements VipFriendManager {

   /**定义Dao*/
   private VipFriendDao vipFriendDao;
   /**增加setXXXX()方法,spring就可以通过autowire自动设置对象属性*/
   public void setVipFriendDao(VipFriendDao dao) {
      this.vipFriendDao = dao;
   }

   /**获取Dao*/
   public EntityDao getEntityDao() {
      return this.vipFriendDao;
   }

   /**
   * <p>分页查询VipFriend<br>
   * @param PageRequest pr
   * @return Page
   * @author
   */
   @Transactional(readOnly=true)
   public Page findByPageRequest(PageRequest pr) {
      return vipFriendDao.findByPageRequest(pr);
   }

   /**
   * <p>批量删除 VipFriend<br>
   * @param VipFriend u
   * @return Boolean
   * @author
   */
   public Boolean  removeByIdArry(VipFriend u) {
      Boolean result =false;
      int i =-1,size=u.getIdList().size();
      i =vipFriendDao.removeByIdArry(u);
      if(i==size){
         result =true;
      }else{
         throw new RuntimeException();
      }
      return result;
   }
	/**
	* <p> Bean查询 <br> 
	* @param VipFriend bean
	* @return  VipFriend
	* @author
	*/

	/**
	* <p>按Bean查询返回List<br> 
	* @param VipFriend bean
	* @return List
	* @author
	*/
	public java.util.List  findListByBean(VipFriend u) { 
		java.util.List<VipFriend> list =  vipFriendDao.findListByBean(u); 
	      return list;
	}
	/**
     * <p>标题: 会员通讯录
     * <p>参数: String menberId  会员
     * <p>描述: 
     * <p>返回: {"list":[{VipFriend}]
     * @see phapp.model.barapp.VipFriend 
     */
    public List  getVipFriendList(java.util.Map map) {
    		java.util.List<VipFriend> list =  vipFriendDao.getVipFriendList(map); 
	        return list;
    }
	/**
	 * <p>通过 Map 修改一条 数据<br> 
	 * @param  java.util.Map 
	*/
    public int updateByMap(java.util.Map map){
    	int count = vipFriendDao.updateByMap(map);
    	return count;
    }
    
}
